package com.excel.validators.core.decorative;

/**
 * @author wangxiaoliang10
 *
 * @param <V>
 * 
 * 受检查对象存储模型基类
 */
abstract class LiveExpression<V> {
	
	/**
	 * The convert value of the expression.
	 */
	private V newValue;
	
	/**
	 * The original value
	 */
	private String oldValue; 
	
	@SuppressWarnings("unchecked")
	public LiveExpression(String oleValue,Object newValue) {
			this.oldValue = oleValue;
			this.newValue = (V) newValue;
	}

	/**
	 * get new value or convert old value
	 */
	public V getValue() {
			return newValue;
	}
	
	/*
	 * get original vlaue
	 */
	public String getOldValue() {
			return oldValue;
	}
	
	/**
	 * restore old value
	 * @param value
	 */
	public void setOldValue(String oldValue) {
			this.oldValue = oldValue;
	}
	
	public void setNewValue(Object newValue) {
			this.newValue = (V) newValue;
	}
}
